import request from '@/utils/request'

export function getList(query) {
  return request({
    url: '/students',
    method: 'get',
    params: query
  })
}

export function getInfo(id) {
  return request({
    url: '/students/' + id,
    method: 'get'
  })
}

export function add(data) {
  return request({
    url: '/students',
    method: 'post',
    data
  })
}

export function update(data) {
  return request({
    url: '/students/' + data.id,
    method: 'post',
    data
  })
}

export function remove(id) {
  return request({
    url: '/students/' + id,
    method: 'delete'
  })
}

export function addBankAccounts(studentId, data) {
  return request({
    url: '/students/' + studentId + '/bank-accounts',
    method: 'post',
    data
  })
}

export function updateBankAccounts(studentId, data) {
  return request({
    url: '/students/' + studentId + '/bank-accounts/' + data.id,
    method: 'post',
    data
  })
}

export function updateAttribute(id, data) {
  return request({
    url: '/students/' + id + '/attribute',
    method: 'post',
    data
  })
}

